<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/view/include/css-include.jsp"%>
<%@ include file="/view/include/jsp-include.jsp"%>
<%@ include file="/view/include/jquery-include.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TMI</title>

<script type="text/javascript">
<%--============================= 전역변수 선언 ==========================--%>

    <%--============================= window onload ==========================--%>

    $().ready(function() {

        <%-- 달력 --%>
        calendar.makeCalender("stockinDate");
        
        if($("#roleId").val() == "3"){
        	$("#orderNumPop").attr("style", "display:none");
            $("#bo_btn").attr("style", "display:none");
        }
        
        var keyparam = '${ordPseq}';
        var keyparam2 = '${ordNo1}';
        var keyparam3 = '${ordNo2}';
        var keyparam4 = '${clearNo}';
        var keyparam5 = '${mawb}';
        var keyparam6 = '${hawb}';
        if(keyparam != null && keyparam != ""){
            view(keyparam2+'-'+keyparam, keyparam2, keyparam3, keyparam, keyparam5, keyparam6, keyparam4);
        }
        
        /* textarea 체크 */
        $("#remark").bind("keyup",function(){
            textAreaKyUp(this);  //조회 직후에도 호출해야해서 function 으로 뺌.. 
        });
        
        /* 오더 조회 팝업 버튼 */
        $("#searchBtn").bind("click",function(){
            orderNumPopCall();
        });
        
        $("#reSetBtn").bind("click",function(){
            reSetFrm();
        });
        
        //삭제
        $("#deleteBtn").bind("click",function(){
            doDelete();
        });
        
        /* 저장버튼 */
        $("#saveBtn").bind("click",function(){       
            $("form[name='stockInFrm']").submit();
        });

        /* 메인폼 서브밋 */
        $("form[name='stockInFrm']").ajaxForm({
            dataType: "json",
            beforeSerialize: function($form, options) {
                //return $("form[name='stockInFrm']").valid();  jquery 벨류데이션 플러그인 사용시
                if( $("#mawb").val() == null || $("#mawb").val() == "" ){
                	alert("SEARCH!!");
                    //alert("조회 후 입력 해주세요.");
                    return false;
                }
                
                 if( !validation() ){       //화면 항목 점검 시작
                    return false;
                }
                 if(!confirm("Save?")){
                    return false;
                 }
            },
            success:function(data) {
               if(data.result == true){
                   alert("Complete the save");
                   searchDataMaping(data);   //조회 데이터 맵핑 펑션
               }               
           },
           error:function(){alert("error!!");}
        }); 
        
    });
    
    <%--============================= function ==========================--%>
    
    /* 삭제 펑션 */
    function doDelete(){
        if( $("#ordNo1").val() == "" || $("#ordNo2").val() == "" || $("#ordPseq").val() == "" ){
            alert("search plz.");
            return;
        }
        
        if(confirm("DELETE?")){
            $.post(
                    '/deleteDoStockIn.json', {
                    ordNo1  : $("#ordNo1").val(),
                    ordNo2  : $("#ordNo2").val(),
                    ordPseq : $("#ordPseq").val(),
                    mawb    : $("#mawb").val(),
                    hawb    : $("#hawb").val(),
                    clearNo : $("#clearNo").val()
                    },
                function(data) {
                        if(data.result == true){
                            alert("OK!!");
                            reSetFrm();    //DATA맵핑 
                            $("span[id='delBtn']").show();
                        }else{
                            alert("error");
                        }
                });
        }
    }
    
    
    
    /* 조회 펑션 */
    function view(ordNum, ordNo1, ordNo2, ordPseq, mawb, hawb, clearNo){
        $("#ordNum").val(ordNum);
        $("#ordNo1").val(ordNo1);
        $("#ordNo2").val(ordNo2);
        $("#ordPseq").val(ordPseq);
        $("#mawb").val(mawb);
        $("#hawb").val(hawb);
        $("#clearNo").val(clearNo);

        $.post(
               '/getStockInView.json', {
                ordNo1 : ordNo1,
                ordNo2 : ordNo2,
                ordPseq : ordPseq,
                mawb : mawb,
                hawb : hawb,
                clearNo : clearNo
               },
           function(data) {

               $("#saveStatus").val("UPDATE"); // 상태값 변경
                    
               searchDataMaping(data);    //DATA맵핑 
           });
        
    }
    
    
    
    /* searchData 맵핑 */
    function searchDataMaping(data){
        var val = ""; 
        for(var v in data.resultMap) {       //상단 조회 결과 맵핑 조회return값이 한건임
            $("#"+v).val(data.resultMap[v]);
        }

        if($("#DEL_CNT").val() > 0 && $("#stockinDate").val() != null){
            $("span[id='delBtn']").hide();
        }else{
            $("span[id='delBtn']").show();
        }
                
        
        //하단 그리드 맵핑
        var contents = "";
        $.each(data.resultDetailList, function(index){  // List로 받아온값 (여러건)
            
            //(Detail 테이블에 조회결과 입히기 jquery말고 그냥 onclick 걸어줌.. (조회 후 del 번튼에 key값 param변수로 입력)
            var rowNum = index+1;
            
            contents += "<tr id='dynamicDetailSearchRow"+rowNum+"'>"
                +'<td align="center" width="5%">'+rowNum+'<input type="hidden" name="ordSeq" id="ordSeq" value="'+this.ordSeq+'">'
                +'<input type="hidden" name="clearSeq" id="clearSeq" value="'+this.clearSeq+'">'
                +'<input type="hidden" name="qty" id="qty" value="'+this.qty+'">'
                +'<td align="center"  width="8%">'+this.batchNo+'</td>'
                +'<td align="left"   width="15%">'+this.goodsName+'</td>';

                if(this.receiverName == "" ){ //출고여부로 변경 해야 함
                    contents += '<td align="center" width="8%"><input type="text" class="inST100"  maxlength="20" name="receiverName" id="receiverName" value="'+this.receiverName+'"/></td>'  
                    + '<td align="center"  width="8%"><input type="text" class="inST100" onkeydown="onlyNum(event);" maxlength="7" name="damQty" id="damQty" value="'+this.damQty+'"/></td>'
                    +'<td align="center"  width="8%"><input type="text" class="inST100" onkeydown="onlyNum(event);" maxlength="7" name="lossQty" id="lossQty" value="'+this.lossQty+'"/></td>'
                    +'<td align="right" width="8%">'+this.qty+'</td>'
                    +'<td align="center"  width="5%"><select name="qurYn" id="qurYn"><option value="N">N</option><option value="Y">Y</option></select></td>'
                    +'<td align="center"  width="5%"><select name="goodsYn" id="goodsYn"><option value="Y">Y</option><option value="N">N</option></select></td>';
                }else{
                    contents += '<td align="center"  width="8%">'+this.receiverName+'</td>'
                    + '<td align="right"  width="8%">'+this.damQty+'</td>'
                    +'<td align="right"  width="8%">'+this.lossQty+'</td>'
                    +'<td align="right" width="8%">'+this.qty+'</td>'
                    +'<td align="left"  width="8%">'+this.qurYn+'</td>'
                    +'<td align="left"  width="5%">'+this.goodsYn+'</td>';
                    
                }

                if(this.receiverName == ""){
                    contents += '<td align="center"  width="5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>';
                }else{
                	if($("#roleId").val() == "3"){
                		contents += '<td align="center"  width="5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>';
                	}else{
                		contents += '<td align="center"  width="5%"><img src="images/web/ic_up.gif" alt="Upate" align="center" id="onUpate" onclick="viewDialogOpen('+this.ordSeq+' , \''+this.clearSeq+'\',\''+this.damQty+'\',\''+this.lossQty+'\',\''+this.receiverName+'\',\''+this.qurYn+'\',\''+this.goodsYn+'\',\''+this.goodsNa+'\')" > </td>';
                	}
                }
                contents +='</tr>';
        });
        $("table[id='stockInDetailTable']").empty().append(contents);  // 조회 값 뿌리기

        //$("#saveStatus").val("UPDATE"); // 상태값 변경
        
    }
    
    <%--================================= FORM 컨트롤 ============================--%>

    /* 초기화 펑션 */
    function reSetFrm(){
            $("form[name='stockInFrm']").each(function(){
                this.reset();
          });
            
          $("span[id='delBtn']").show();
          $("#saveStatus").val("SAVE");     //신규 입력 상태로 변경
          $("table[id='stockInDetailTable']").empty();
    }
    
    function validation(){
  
        var stockinDate        = $("#stockinDate").val();
        if(stockinDate==null           || stockinDate=="") {   alert("StockIn Date: Required fields."); $("#stockinDate").focus(); return false; }
        if( !isValidDate(stockinDate,"StockIn Date") ){ $("#localDate").focus(); return false; }
 /*       var vehicleNo        = $("#vehicleNo").val();
        
        
        if(vehicleNo==null           || vehicleNo=="") {   alert("Vehicle NO: Required fields."); $("#vehicleNo").focus(); return false; }

        
        //if(ordNo1.length < 5) {   alert("order No: Enter the 5 characters"); $("#ordNo1").focus(); return false; }
        
        
 */
/*      var ordDate         = $("#ordDate").val();
        var originCode      = $("#originCode").val();
        var originName      = $("#originName").val();
        var packingDesc     = $("#packingDesc").val();
        var reqDate         = $("#reqDate").val();
        var priceBase       = $("#priceBase").val();
        var scheduleDate    = $("#scheduleDate").val();
        var portOfLoadName  = $("#portOfLoadName").val();
        var transMethodName = $("#transMethodName").val();
 */
        
        
/*      if(ordDate==null         || ordDate=="") { alert("ordDate 입려하시오."); $("#ordDate").focus(); return false; }
        if(originCode==null      || originCode=="") { alert("originCode 입려하시오."); $("#originCode").focus(); return false; }
        if(originName==null      || originName=="") { alert("originName 입려하시오."); $("#originName").focus(); return false; }
        if(packingDesc==null     || packingDesc=="") { alert("packingDesc 입려하시오."); $("#packingDesc").focus(); return false; }
        if(reqDate==null         || reqDate=="") { alert("reqDate 입려하시오."); $("#reqDate").focus(); return false; }
        if(priceBase==null       || priceBase=="") { alert("priceBase 입려하시오."); $("#priceBase").focus(); return false; }
        if(scheduleDate==null    || scheduleDate=="") { alert("scheduleDate 입려하시오."); $("#scheduleDate").focus(); return false; }
        if(portOfLoadName==null  || portOfLoadName=="") { alert("portOfLoadName 입려하시오."); $("#portOfLoadName").focus(); return false; }
        if(transMethodName==null || transMethodName=="") { alert("transMethodName 입려하시오."); $("#transMethodName").focus(); return false; }

        if( !isValidDate(ordDate,"ordDate") ){ $("#ordDate").focus(); return false; }
        if( !isValidDate(reqDate,"reqDate") ){ $("#reqDate").focus(); return false; }
        if( !isValidDate(scheduleDate,"scheduleDate") ){ $("#scheduleDate").focus(); return false; }
        
 */     

         for(var i=0 ; i < $("[name=clearSeq]").length ; i++){
        	var receiverNameTmp = $("[name=receiverName]").eq(i).val();
            var damQtyTmp = $("[name=damQty]").eq(i).val();
            var lossQtyTmp = $("[name=lossQty]").eq(i).val();
/*             var damLossStrTmp = $("[name=damLossStr]").eq(i).val(); */
            var qtyTmp = $("[name=qty]").eq(i).val();
            
            if(receiverNameTmp == ""){
                alert("Receiver : Required fields.");
                $("[name=receiverName]").eq(i).focus();
                return false;
            }
            if(damQtyTmp == ""){
            	alert("damQty : Required fields.");
            	$("[name=clearSeq]").eq(i).focus();
            	return false;
            }
            if(lossQtyTmp == ""){
                alert("LossQty : Required fields.");
                $("[name=lossQty]").eq(i).focus();
                return false;
            }
            
/*             if( (parseInt(damQtyTmp) > 0 ) || (parseInt(lossQtyTmp) > 0) ){
                if($.trim(damLossStrTmp) == ""){
                    alert("Reason : Required fields.");
                    $("[name=damLossStr]").eq(i).focus(); 
                    return false;
                }
            } */
            
            if( ( parseInt(damQtyTmp) + parseInt(lossQtyTmp) )  > qtyTmp ){
                alert("분실/하자 수량이 원 수량을 초과 하였습니다.");
                $("[name=damQty]").eq(i).focus();
                return false;
            }
        }
      
      return true;      
    } 
    
    /************************************************************************/
    /*                          view POPUP , 리턴값처리                     */
    /************************************************************************/
    function viewDialogOpen(ordSeq, clearSeq, damQty, lossQty, receiverName, qurYn, goodsYn, goodsNa){
        $("#pop_ordSeq").val(ordSeq);
        $("#pop_clearSeq").val(clearSeq);
        $("#pop_damQty").val(damQty);
        $("#pop_lossQty").val(lossQty);
/*         $("#pop_damLossStr").val(damLossStr); */
        $("#pop_receiverName").val(receiverName);
        $("#pop_qurYn").val(qurYn);
        $("#pop_goodsYn").val(goodsYn);
        $("#pop_goodsNa").val(goodsNa);
        
        
        $("#viewDialog").dialog({
            modal:true, 
            width:300,
            title:"Detail Update"
        });
        
        if( qurYn == "Y" ){
        	$("#pop_goodsNa").val("N");
        } 
    }


    /* detail update*/
    function detailUpdate(){

        /* if(confirm("Update?")){ */
            $.post("/stockInDetailUpdate.json",{
                ordNo1          : $("#ordNo1").val(),
                ordNo2          : $("#ordNo2").val(),
                ordPseq         : $("#ordPseq").val(),
                mawb            : $("#mawb").val(),
                hawb            : $("#hawb").val(),
                clearNo         : $("#clearNo").val(),
                ordSeq          : $("#pop_ordSeq").val(),
                clearSeq        : $("#pop_clearSeq").val(),
                damQty          : $("#pop_damQty").val(),
                lossQty         : $("#pop_lossQty").val(),
/*                 damLossStr      : $("#pop_damLossStr").val(), */
                receiverName    : $("#pop_receiverName").val(),
                qurYn           : $("#pop_qurYn").val(),
                goodsYn         : $("#pop_goodsYn").val(),
                goodsNa         : $("#pop_goodsNa").val()
            },function(data){
                if(data.result == true){
                    $("#viewDialog").dialog("close");
                    view($("#ordNum").val() , $("#ordNo1").val() , $("#ordNo2").val() ,$("#ordPseq").val() ,$("#mawb").val(), $("#hawb").val(), $("#clearNo").val());
                }
            });
        /* } */
    }

    /* 검색 팝업 버튼 */
    function orderNumPopCall(){
        window.open('/mawbHawbNumPop.html?menuType=STOCKIN', 'mawbHawbNumPop', 'width=520, height=520, toolbar=no, location=no, status=no, menubar=no, scrollbars=no');
    };
       
    function detailClose(){
        $("#viewDialog").dialog("close");
        view($("#ordNum").val() , $("#ordNo1").val() , $("#ordNo2").val() ,$("#ordPseq").val() ,$("#mawb").val(), $("#hawb").val(), $("#clearNo").val());
    };
    
    function qurYnChk(val){
    	if(val == "N" ){
    		$("#pop_goodsYn").val("Y");
    	}else{
    		$("#pop_goodsNa").val("N");
    	}
    };
    
    function qurMsg(val,type){
    	if(type == "Yn" && val == "N"){
    		if($("#pop_qurYn").val() == "N" ){
    			alert("QR YN = 'N' is Goods YN = 'Y' ");
    			$("#pop_goodsYn").val("Y");
    		}
    	}
    	
    	if(type == "Na" && val == "Y"){
    		if($("#pop_qurYn").val() == "Y" ){
                alert("QR YN = 'N' is Goods N/A = 'N' ");
                $("#pop_goodsNa").val("N");
            }
    	}
    }
</script>
</head>


<body>
<div class="wrap">
    <div class="pagetitle">
        <h1>STOCK IN</h1>
    </div>
    <div class="">
    <!-- 레이어 팝업시작 -->
        <div id="viewDialog" style="display: none; background: white;">
         <input type="hidden" id="pop_ordSeq">
         <input type="hidden" id="pop_clearSeq">

           <table class="TableST">
             <tr>
               <th>ReceiverName</th>
               <td><input type="text" name="pop_receiverName" id="pop_receiverName" class="inST50" maxlength="20"/></td>
             </tr>
             <tr>
               <th>Dam Qty</th>
               <td><input type="text" name="pop_damQty" id="pop_damQty" class="inST50" maxlength="20"/></td>
             </tr>
             <tr>
               <th>Loss Qty</th>
               <td><input type="text" name="pop_lossQty" id="pop_lossQty" class="inST50" maxlength="20"/></td>
             </tr>
<!--              <tr>
               <th>CAUSE</th>
               <td><input type="text" name="pop_damLossStr" id="pop_damLossStr" class="inST50" maxlength="20"/></td>
             </tr> -->
             <tr>
               <th>QR YN</th>
               <td><select name="pop_qurYn" id="pop_qurYn" onchange="qurYnChk(this.value)"><option value="N">N</option><option value="Y">Y</option></select></td>
             </tr>
             <tr>
               <th>Goods YN</th>
               <td><select name="pop_goodsYn" id="pop_goodsYn" onchange="qurMsg(this.value,'Yn')"><option value="Y">Y</option><option value="N">N</option></select></td>
             </tr>
             <tr>
               <th>Goods N/A</th>
               <td><select name="pop_goodsNa" id="pop_goodsNa" onchange="qurMsg(this.value,'Na')"><option value="N">N</option><option value="Y">Y</option></select></td>
             </tr>
           </table>
            <div class="bo_btn">
                <ul class="btnst"><li class="a"><a href="javascript: detailUpdate();" id="save" >Save</a></li></ul>
                <ul class="btnst"><li class="a"><a href='javascript:detailClose();' >CLOSE</a></li></ul>
            </div>    
       </div>
    <!-- 레이어 팝업끝 -->   
    
    <input type="hidden" id ="DEL_CNT" name="DEL_CNT"/>   
    <form name="stockInFrm" method="post" action="/saveStockIn.json"> <%--리턴값 json으로 설정 --%>
    <input type="hidden" id ="saveStatus" name="saveStatus" value="SAVE" />     <%-- 조회, 수정, 초기화, 최초 입력 시 필요 (최초, 초기화 후 = SAVE   ,  수정, 조회 후 = UPDATE)--%>
    <input type="hidden" id ="ordNo1" name="ordNo1"/>
    <input type="hidden" id ="ordNo2" name="ordNo2"/>
    <input type="hidden" id ="ordPseq" name="ordPseq"/>
    <input type="hidden" id ="clearNo" name="clearNo"/>
    
        <table class="TableST">
<!--             <tr>
                <th>Order No</th>
                <td colspan="3">
                    <input type="text" class="inSTR30" id="ordNum" name="ordNum" readonly onFocus="blur();" value=""/></td>
            </tr> -->
            <tr>
                <th>MAWB</th>
                <td><input type="text" class="inSTR90" id="mawb" name="mawb" readonly onFocus="blur();" value="">
                    <img alt="Search" height="16" id="orderNumPop" onclick="orderNumPopCall();" src='/images/web/bkn_zoom.gif' align='absmiddle'>
                </td>
                <th class="thST2">HAWB</th>
                <td>
                    <input type="text" class="inSTR90" id="hawb" name="hawb" readonly onFocus="blur();" value=""/>
                </td>
            </tr>
            <tr>
                <th >Shipper</th>
                <td colspan="2">
                    <input type="text" class="inSTR10" id="sCustCode" name="sCustCode" readonly onFocus="blur();" value=""/>
                    <input type="text" class="inSTR80" style="width:85%;" id="sCustName" name="sCustName" readonly onFocus="blur();" value=""/></td>
                <td><input type="text" class="inSTR90" id="sAddr1" name="sAddr1" readonly onFocus="blur();" value=""/></td>
            </tr>
            <tr>
                <th> </th>
                <td><input type="text" class="inSTR100"id="sTel" name="sTel" readonly onFocus="blur();" value=""/></td>
                <td><input type="text" class="inSTR90" id="sFax" name="sFax" readonly onFocus="blur();" value=""/></td>
                <td><input type="text" class="inSTR90" id="sAddr2" name="sAddr2" readonly onFocus="blur();" value=""/></td>
            </tr>
            <tr>
                <th >Messrs</th>
                <td colspan="2">
                    <input type="text" class="inSTR10" id="mCustCode" name="mCustCode" readonly onFocus="blur();" value=""/>
                    <input type="text" class="inSTR80" style="width:85%;" id="mCustName" name="mCustName" readonly onFocus="blur();" value=""/></td>
                <td><input type="text" class="inSTR90" id="mAddr1" name="mAddr1" readonly onFocus="blur();" value=""/></td>
            </tr>
            <tr>
                <th></th>
                <td><input type="text" class="inSTR100" id="mTel" name="mTel" readonly onFocus="blur();" value=""/></td>
                <td><input type="text" class="inSTR90"  id="mFax" name="mFax" readonly onFocus="blur();" value=""/></td>
                <td><input type="text" class="inSTR90"  id="mAddr2" name="mAddr2" readonly onFocus="blur();" value=""/></td>
            </tr>
            <tr>
                <th >Notify Party</th>
                <td colspan="2">
                    <input type="text" class="inSTR10" id="nCustCode" name="nCustCode" readonly onFocus="blur();" value=""/>
                    <input type="text" class="inSTR80" style="width:85%;" id="nCustName" name="nCustName" readonly onFocus="blur();" value=""/></td>
                <td><input type="text" class="inSTR90" id="nAddr1" name="nAddr1" readonly onFocus="blur();" value=""/></td>
            </tr>
            <tr>
                <th></th>
                <td><input type="text" class="inSTR100" id="nTel" name="nTel" readonly onFocus="blur();" value=""/></td>
                <td><input type="text" class="inSTR90"  id="nFax" name="nFax" readonly onFocus="blur();" value=""/></td>
                <td><input type="text" class="inSTR90"  id="nAddr2" name="nAddr2" readonly onFocus="blur();" value=""/></td>
            </tr>
            <tr> 
                <th>Packing</th>
                <td colspan="3">
                    <input type="text" class="inSTR90" style="width:96%;" id="packing" name="packing" readonly onFocus="blur();" value=""/>
                </td>
            </tr>
            <tr>
                <th>Stored at</th>
                <td colspan="3">
                    <input type="text" class="inSTR90" style="width:96%;" id="storedAt" name="storedAt" readonly onFocus="blur();" value=""/>
                </td>
            </tr>
            <tr>
                <th>Loding</th>
                <td><input type="text" class="inSTR90" id="loading" name="loading" readonly onFocus="blur();" value=""></td>
                <th class="thST2">Destination</th>
                <td>
                    <input type="text" class="inSTR90" id="destination" name="destination" readonly onFocus="blur();" value=""/>
                </td>
            </tr>
            <tr>
                <th>Sailing on</th>
                <td>
                    <input type="text" class="inSTR90" id="sailingOn" name="sailingOn" readonly onFocus="blur();" value=""/>
                </td>
                <th class="thST2">Net-Weight</th>
                <td>
                    <input type="text" class="inSTR90" id="net" name="net" readonly onFocus="blur();" value=""/>
                </td>
            </tr>
            <tr>
                <th>Carrior</th>
                <td><input type="text" class="inSTR90" id="carrien" name="carrien" readonly onFocus="blur();" value=""></td>
                <th class="thST2">Gross-Weight</th>
                <td>
                    <input type="text" class="inSTR90" id="gross" name="gross" readonly onFocus="blur();" value=""/>
                </td>
            </tr>
            <tr>
                <th>Carton</th>
                <td width="290px"><input type="text" class="inSTR90" id="carton" readonly onFocus="blur();" name="carton" value=""></td>
                <th class="thST2">Cubic-M</th>
                <td>
                    <input type="text" class="inSTR90" readonly onFocus="blur();" id="cubic" name="cubic" value=""/>
                </td>
            </tr>
            <tr>
                <th>Arrival Date</th>
                <td width="290px">
                    <input type="text" class="inSTR90" id="arrDate" name="arrDate" readonly onFocus="blur();" value=""/>
                </td>
                <th>Customs Clearance Date</th>
                <td width="290px">
                    <input type="text" class="inSTR90" id="clearDate" name="clearDate" readonly onFocus="blur();" value=""/>
                </td>
            </tr>
            <tr>
                <th>Import Declaration No.</th>
                <td width="290px">
                    <input type="text" class="inSTR90" id="importNo" name="importNo" maxlength="20" value=""/>
                </td>
                <th>Local Delivery Date</th>
                <td width="290px">
                    <input type="text" class="inSTR90" id="localDate" name="localDate" readonly onFocus="blur();" value=""/>
                </td>
            </tr>
            <tr>
                <th>Vehicle NO</th>
                <td width="290px">
                    <input type="text" class="inSTR90" id="vehicleNo" name="vehicleNo" readonly onFocus="blur();" value=""/>
                </td>
                <th>Local B/L<br>transportation No</th>
                <td width="290px">
                    <input type="text" class="inSTR90" id="transNo" name="transNo" maxlength="20" value=""/>
                </td>
            </tr>
             <tr>
                <th>Temperature</th>
                <td width="290px">
                    <input type="text" class="inSTR90" id="tempWh" name="tempWh" maxlength="20" value=""/>
                </td>
                <th>Stock In Date</th>
                <td width="290px">
                    <input type="text" class="inST80" id="stockinDate" name="stockinDate" value=""/>
                </td>
            </tr>
             <tr>
                <th>ConfirmGoods NO</th>
                <td width="290px">
                    <input type="text" class="inST90" id="confirmGoodsNo" name="confirmGoodsNo" value=""/>
                </td>
                <th>Temperature IN</th>
                <td width="290px">
                    <input type="text" class="inST90" id="tempIn" name="tempIn" value=""/>
                </td>
            </tr>
        </table>
        <br />
        <div class="taHeadW">
            <table class="TableST2Head" >
                <tr>
                    <th width="5%">No</th>
                    <th width="8%">Batch</th>
                    <th width="15%">Description</th>
                    <th width="8%">Receiver</th>
                    <th width="8%">Dam</th>
                    <th width="8%">Loss</th>
                    <th width="8%">Q'ty</th>
                    <th width="8%">QR YN</th>
                    <th width="5%">GoodsYN</th>
                    <th width="5%">U</th>
                </tr>
            </table>
        </div>
        <div class="taBodyW">
            <table class="TableST2Body" id="stockInDetailTable">
            </table>
        </div>    
        <br />
        <table class="TableST3">
            <tr>
                <th width="20%">Remarks</th>
                <td><textarea class="teST80" wrap="virtual" style="background:#eeeeee;" id="remark" name="remark" readonly onFocus="blur();" ></textarea></td>
            </tr>
        </table>
    </div>
    <div class="bo_btn" id="bo_btn" style="display: block;">
        <ul class="btnst"><li class="a"><a href="#" id="reSetBtn" >INIT</a></li></ul>
        <ul class="btnst"><li class="a"><a href="#" id="searchBtn" >SEARCH</a></li></ul>
        <ul class="btnst"><li class="a"><a href="#" id="saveBtn" >SAVE</a></li></ul>
        <span id="delBtn"><ul class="btnst"><li class="a"><a href="#" id="deleteBtn" >DELETE</a></li></ul></span>
    </div>
    <input type="hidden" name="roleId" id="roleId" value="${requestScope.roleId}">
    </form>
</div>
</body>
</html>